package com.estore.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.estore.info.ProfileInfo;

public class ProfileInfoMapper implements RowMapper<ProfileInfo> {

	@Override
	public ProfileInfo mapRow(ResultSet rs, int arg1) throws SQLException {
		ProfileInfo info = new ProfileInfo();
		// info.setUserID(rs.getInt("userid"));
		info.setRole(rs.getInt("Role"));
		info.setIsBanned(rs.getInt("isBanned"));
		info.setAccount(rs.getString("account"));
		info.setPassword(rs.getString("pwd"));
		info.setSecretQuestion(rs.getString("secretQuestion"));
		info.setSecretAnswer(rs.getString("secretAnswer"));
		info.setFirstName(rs.getString("firstName"));
		info.setLastName(rs.getString("lastName"));
		info.setEmail(rs.getString("email"));
		info.setDateOfBirth(rs.getString("dateOfBirth"));
		info.setSex(rs.getString("sex"));
		info.setAddress(rs.getString("address"));
		info.setPhoneNumber(rs.getString("phonenumber"));
		info.setAvatar(rs.getString("avatar"));
		return info;
	}

}
